package cn.kgc.springcloud.controller;

import cn.kgc.springcloud.feignclient.HystrixClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: mosin
 * @version: v1.0  2022/6/11
 */
@RestController
@RequestMapping("open")
public class OpenfeignController {
    @Autowired
    private HystrixClient hystrixClient;
    @RequestMapping("open1")
    public String test01(){
        String s = hystrixClient.test01(-1);
        System.out.println("hystrix服务端返回的数据 = " + s);
        return "openfeign ok";
    }

    @RequestMapping("open2")
    public String test02(){
        String s = hystrixClient.test01(1);
        System.out.println("open2请求hystrix服务端返回的数据 = " + s);
        return "openfeign ok";
    }
}
